package com.visionork.android.tai.model.adapter;

import java.util.ArrayList;

import com.visionork.android.tai.TaiApp;
import com.visionork.android.tai.model.Program;

public class FavoriteProgramAdapter extends TaiAdapterBase {

	public FavoriteProgramAdapter(String urlLink) {
		super(urlLink);
	}

	@Override
	public ArrayList<?> getData() {
		ArrayList<Program> programs = new ArrayList<Program>();
		ArrayList<Program> showPrograms = TaiApp.getShowRepository()
				.getPrograms();
		for (Program prog : showPrograms) {
			if (prog.isFavorite()) {
				programs.add(prog);
			}
		}

		ArrayList<Program> dramaPrograms = TaiApp.getDramaRepository()
				.getPrograms();
		for (Program prog : dramaPrograms) {
			if (prog.isFavorite()) {
				programs.add(prog);
			}
		}

		return programs;
	}

}
